#pragma once
#include <d3d9.h>
#pragma comment(lib, "d3d9.lib")
#include <d3dx9.h>
#pragma comment(lib, "d3dx9.lib")
#include <DxErr.h>
#pragma comment(lib, "dxerr.lib")

#include "Usefuls.h"

// NOTE: This used to be an abstract class, but is now has functionality on its own as of REV __

// base object class
class Drawable
{
protected:
	Vec3D					m_v3Position;						// position in the three-dimensional world
	Rotation				m_rRotation;						// rotation in terms of yaw, pitch, and roll
	float					m_fScale;							// uniform scale of the object
	D3DXMATRIX				m_matTrans;
	D3DXMATRIX				m_matRotation;
	D3DXMATRIX				m_matScale;

public:
	// drawing related member variables
	int owner;													// what object is responsible for this object (ie player1, player2, board)
	int						m_iTextureIndex;					// the index of the texture in graphics' mesh array
	int						m_iMeshIndex;						// the index of the mesh in the graphics' mesh array
	int						m_iType;							// the type of drawable this is (for use in derived classes)
	bool					m_bSelected;

	Drawable();													// default ctor
	Drawable(float xPos, float yPos, float zPos);				// overloaded ctor allowing different position to be set
	virtual bool Init(int type, int owner, Vec3D pos);			// pure virtual init function, making this an abstract class
	virtual void CreateWorldTransform(D3DXMATRIX &matWorld){}	// creates the world transform based on position, rotation, and scale of the object
	virtual void Rotate(int direction){}
	Vec3D getPos() { return m_v3Position; }
	void setPos(Vec3D a_Pos) {m_v3Position = a_Pos;}

	~Drawable();												// destructor deallocates and releases pointer memory
};